package com.hm.ibsm.su;

import com.hm.common.network.httpclient.HttpClientFactory;
import com.hm.ibsm.manage.vo.auth.AuthUserVo;
import com.hm.ibsm.su.R.ReqAuthKeyDef;
import com.hm.ibsm.su.auto.IbsmManageConfiguration;

/**
 * @author shishun.wang
 * @date 2017年2月18日 下午5:22:42
 * @version 1.0
 * @describe
 */
public class LocationConfig {

	private LocationConfig() {
	}

	public static String baseUri(String uri) {
		return IbsmManageConfiguration.getInstance().get(R.Configuration.HOST) + uri;
	}

	public static HttpClientFactory accredit(HttpClientFactory factory) {
		AuthUserVo authUser = GlobalContent.getInstance().getCurrentAuthUser();
		return factory.headers(ReqAuthKeyDef.AUTHOR_TOKEN, authUser.getToken()).headers(ReqAuthKeyDef.AUTHORIZATION, authUser.getSecretKey());
	}
}
